﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AdminUser.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <!--#include virtual="include/Head.ascx"-->
</head>
<body>
    <div id="body-wrapper">
        <div id="header">
            <!--#include virtual="include/top.ascx"-->
        </div>
        <div id="main-content1">
            <div class="">
            </div>
            <h2>
                Account information</h2>
            <div class="clear">
            </div>
            <div class="content-box">
                <form id="frmEdit" runat="server" method="post">
                <script type="text/javascript">
                    $(document).ready(function () {

                        $.validator.addMethod(
                              "FormatUniqueString",
                              function (value, element) {
                                  return illegalCharsUserName.test(value) != true;
                              },
                              "Không được nhập có ký tự đặc biệt!");
                        $('#frmEdit').validate({
                            errorElement: "em",
                            errorPlacement: function (error, element) { error.appendTo(element.parent("td").next("td")); },
                            submitHandler: function (form) { form.submit(); },
                            rules: {
                                txtUserName: { required: true },
                                //txtEmail: {required: false, email: true}, 
                                txtPassword: { required: true },
                                txtConfirmPassword: { equalTo: "#frmEdit input[name=txtPassword]" }
                            },
                            messages: {
                                txtUserName: { required: "Tên đăng nhập không được để trống!" },
                                // txtEmail: {required: "Email không được để trống!", email: "Email không đúng định dạng!"}, 
                                txtPassword: { required: "Mật khẩu không được để trống!" },
                                txtConfirmPassword: { equalTo: "&nbsp;&nbsp; Mật khẩu gõ lại không chính xác" }
                            }
                        });
                    });
                </script>
                <div class="content-box-header">
                    <h3 style="cursor: s-resize;">
                    </h3>
                    <asp:Label ID="lblerror" runat="server" CssClass="error"></asp:Label>
                    <div class="clear">
                    </div>
                </div>
                <fieldset class="adminform">
                    <!--<legend style="padding-left:0px;"></legend>-->
                    <table class="paramlist admintable" width="100%">
                        <tr>
                            <td class="key" align="left" width="20%">
                                Tên đăng nhập:
                            </td>
                            <td align="left" width="200px">
                                <asp:TextBox ID="txtUserName" name="txtUserName" runat="server" Width="200px"></asp:TextBox>
                            </td>
                            <td align="left" class="row_error title_fontend" title="Row Error">
                            </td>
                        </tr>
                        <tr>
                            <td class="key" align="left" width="20%">
                                Mã đăng nhập:
                            </td>
                            <td align="left" width="200px">
                                <input type="password" id="txtPassword" name="txtPassword" value="<%=strPassword%>"
                                    width="200px" />
                            </td>
                            <td align="left" class="row_error title_fontend" title="Row Error">
                            </td>
                        </tr>
                        <tr>
                            <td class="key" align="left" width="20%">
                                Nhập lại mã đăng nhập:
                            </td>
                            <td align="left" width="200px">
                                <input type="password" id="txtConfirmPassword" name="txtConfirmPassword" value="<%=strPassword%>"
                                    width="200px" />
                            </td>
                            <td class="row_error title_fontend" title="Row Error">
                            </td>
                        </tr>
                        <tr>
                            <td class="key" align="left" width="20%">
                                Email:
                            </td>
                            <td align="left" width="200px">
                                <asp:TextBox ID="txtEmail" runat="server" Width="200px"></asp:TextBox>
                            </td>
                            <td align="left" class="row_error title_fontend" title="Row Error">
                            </td>
                        </tr>
                        <%if ((Session["superadmin"] != null) && (int.Parse(Session["superadmin"].ToString()) >= 3))
                              {%>
                        <tr>
                            <td class="key" align="left" width="20%">
                                Tỉnh:
                            </td>
                            <td align="left" width="200px">
                                <asp:DropDownList ID="drProvince" runat="server" Width="200px">
                                </asp:DropDownList>
                            </td>
                            <td align="left" class="row_error title_fontend" title="Row Error">
                            </td>
                        </tr>
                        <tr style="display: none;">
                            <td class="key" align="left" width="20%" style="display: none;">
                                <%-- Location:--%>
                            </td>
                            <td align="left" width="200px">
                                <asp:Label ID="lblLocation" runat="server" Visible="false"></asp:Label><br />
                                <asp:ListBox ID="listLocation" runat="server" Visible="false" Width="200px" runat="server"
                                    SelectionMode="Multiple" Rows="15"></asp:ListBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="key" align="left" width="20%">
                                Vung:
                            </td>
                            <td align="left" width="200px">
                                <asp:Label ID="Label1" runat="server"></asp:Label><br />
                                <asp:CheckBoxList ID="cbVung" runat="server" Style="width: 400px; border-style: hidden;"
                                    RepeatDirection="Horizontal">
                                    <%--<asp:ListItem Text="Hải Phòng" Value="1"></asp:ListItem>
                                    <asp:ListItem Text="Đà Nẵng" Value="2"></asp:ListItem>
                                    <asp:ListItem Text="Hồ Chí Minh" Value="3"></asp:ListItem>
                                    <asp:ListItem Text="Quy Nhơn" Value="4"></asp:ListItem>
                                    <asp:ListItem Text="Cái Lân" Value="5"></asp:ListItem>--%>
                                </asp:CheckBoxList>
                            </td>
                        </tr>
                        <tr style="display: none;">
                            <td class="key" align="left" width="20%">
                                Trưởng phòng:
                            </td>
                            <td align="left" width="200px">
                                <asp:DropDownList ID="ddHeadOfDep" runat="server" Width="200px" runat="server">
                                </asp:DropDownList>
                            </td>
                        </tr>
                        <%} %>
                    </table>
                    <div style="padding-left: 10em; margin-top: 5px; width: 100%">
                        <asp:Button ID="btnSave" runat="server" Text="Update" class="button" OnClick="btnSave_Click1" />
                        <!--asp:Button ID="btnBack"  Text="Back" class="button" OnClick="btnBack_Click1" /-->
                        <input type="button" id="Back" value="Back" class="button" onclick="window.location.href='AdminUserList.aspx';" />
                    </div>
                </fieldset>
                </form>
            </div>
            <div id="footer">
                &nbsp;</div>
        </div>
    </div>
</body>
</html>
